﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
public partial class Common_GridPic : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["DT"] == null)
        {
            Response.Write("未查到数据");
            Response.End();
            return;
        }
        else
        {
            DataTable dt = (DataTable)Session["DT"];
           //  dt.Columns.Remove("POS");

            Response.ClearContent();
            HZ.MBSM.BLL.Wrapper w = new HZ.MBSM.BLL.Wrapper();
            w.Font = new System.Drawing.Font("宋体", 12f);
            w.FontColor = System.Drawing.Color.White;
            w.DrawvLines = true;
            w.DrawHLines = true;
            w.OddColor = System.Drawing.ColorTranslator.FromHtml("#f0f0f0");
            w.HeadColor = System.Drawing.ColorTranslator.FromHtml("#6188ff");
            System.Drawing.Image img = w.GetImg(dt);

            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            img.Save(ms, System.Drawing.Imaging.ImageFormat.Png);

            Response.ContentType = "image/Gif";
            Response.BinaryWrite(ms.ToArray());
        }
    }
}
